from apscheduler.schedulers.background import BackgroundScheduler
#from apscheduler.schedulers.blocking import BlockingScheduler

import subprocess

def qq():
    subprocess.Popen('scrapy crawl qq', shell=True)

def tecent():
    subprocess.Popen('scrapy crawl tecent', shell=True)

if __name__ == "__main__":
    scheduler = BackgroundScheduler(daemon=False)
    scheduler.add_job(qq, 'cron', second=28, max_instances=3)
    scheduler.add_job(tecent, 'cron', second=2, max_instances=3)
    scheduler.start()
